package com.smart.community.work.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 员工VO
 * 
 * @author Wu.Liang
 * @since 2025-01-30
 * @version 1.0.0
 */
@Data
@Schema(description = "员工VO")
public class StaffVO {

    @Schema(description = "员工ID")
    private Long id;

    @Schema(description = "用户ID")
    private Long userId;

    @Schema(description = "员工姓名")
    private String realName;

    @Schema(description = "员工编号")
    private String employeeNo;

    @Schema(description = "手机号")
    private String phone;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "头像")
    private String avatar;

    @Schema(description = "状态：1-在职，0-离职，2-待入职")
    private Integer status;

    @Schema(description = "状态文本")
    private String statusText;

    @Schema(description = "部门")
    private String department;

    @Schema(description = "职位")
    private String position;

    @Schema(description = "入职日期")
    private LocalDate joinDate;

    @Schema(description = "物业公司ID")
    private Long propertyCompanyId;

    @Schema(description = "物业公司名称")
    private String propertyCompanyName;

    @Schema(description = "社区ID")
    private Long communityId;

    @Schema(description = "社区名称")
    private String communityName;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    @Schema(description = "创建人")
    private String createBy;

    @Schema(description = "更新人")
    private String updateBy;

    /**
     * 获取状态文本
     */
    public String getStatusText() {
        if (status == null) {
            return "未知";
        }
        switch (status) {
            case 1:
                return "在职";
            case 0:
                return "离职";
            case 2:
                return "待入职";
            default:
                return "未知";
        }
    }
}
